﻿using DocumentFormat.OpenXml.Lite.DrawingML;
using DocumentFormat.OpenXml.Lite.DrawingML.Types;
using DocumentFormat.OpenXml.Lite.PresentationML.Presentation.Base;
using DocumentFormat.OpenXml.Lite.PresentationML.Presentation.Types;
using DocumentFormat.OpenXml.Lite.Xml;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml.Schema;
using System.Xml.Serialization;

namespace DocumentFormat.OpenXml.Lite.PresentationML.Presentation.SlideElements
{
    [XmlRoot("bg", Namespace = Constants.Presentation)]
    public class Background : XmlSerializable
    {
        [Optional]
        [XmlAttribute("bwMode", Form = XmlSchemaForm.Qualified)]
        public Nullable<ST_BlackWhiteMode> BlackWhiteMode { get; set; }

        [XmlElement("", Namespace = Constants.Presentation)]
        public IBackgroundElement Element { get; set; }

        public Background() { }
    }

    [XmlRoot("bgPr", Namespace = Constants.Presentation)]
    public class BackgroundProperties:XmlSerializable, IBackgroundElement
    {
        [Optional]
        [XmlAttribute("shadeToTitle", Form = XmlSchemaForm.Qualified)]
        public Nullable<bool> ShadeToTitle { get; set; }

        [XmlElement("", Namespace = Constants.Graphic)]
        public IFillProperty Fill { get; set; }

        [Optional]
        [XmlElement("", Namespace = Constants.Graphic)]
        public IEffectProperty Effect { get; set; }

        [Optional]
        [XmlElement("extLst", Namespace = Constants.Presentation)]
        public ExtensionList ExtensionList { get; set; }

        public BackgroundProperties() { }
    }

    [XmlRoot("bgRef", Namespace = Constants.Presentation)]
    public class BackgroundReference : XmlSerializable, IBackgroundElement
    {
        [XmlAttribute("idx", Form = XmlSchemaForm.Qualified)]
        public uint Index { get; set; }

        [Optional]
        [XmlElement("", Namespace = Constants.Graphic)]
        public IColorElement ColorElement { get; set; }

        public BackgroundReference() { }
    }
}
